/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.system.service;


import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.core.tool.support.Kv;
import org.springblade.modules.auth.dto.*;
import org.springblade.modules.auth.enums.UserEnum;
import org.springblade.modules.auth.provider.UserType;
import org.springblade.modules.system.pojo.entity.UserInfo;
import org.springblade.modules.system.pojo.entity.UserOauth;
import org.springblade.modules.system.pojo.entity.cuser.AgentUser;

/**
 * 服务类
 *
 * @author Chill
 */
public interface IAgentUserService extends IService<AgentUser> {

    /**
     * 根据租户，账号密码，用户类型获取用户信息
     *
     * @param tenantId 租户id
     * @param account 账号
     * @param password 密码
     * @param userEnum 用户类型
     * @return UserInfo
     */
    UserInfo userInfo(String tenantId, String account, String password, UserEnum userEnum);

    /**
     * 根据租户id，手机号，用户类型为分销 获取用户信息
     * @param tenantId 租户id
     * @param phone 手机号
     * @param userEnum 用户类型
     * @return UserInfo
     */
    UserInfo userInfo(String tenantId, String phone, UserEnum userEnum);

    /**
     * 用户信息
     *
     * @param userOauth
     * @return
     */
    UserInfo userInfo(UserOauth userOauth);

    /**
     * 用户信息
     *
     * @param userId
     * @return
     */
    UserInfo userInfo(Long userId);

    /**
     * 用户信息
     *
     * @param userId
     * @param userEnum
     * @return
     */
    UserInfo userInfo(Long userId, UserEnum userEnum);

    /**
     * 注册用户
     *
     * @param dto 注册信息
     * @return Kv
     */
    Kv registerGuest(UserRegisterDTO dto);

    /**
     * 用户密码找回
     *
     * @param dto 找回信息
     * @return boolean
     */
    boolean userRetrievePass(UserRegisterDTO dto);

    /**
     * 用户密码修改
     * @param dto 密码修改dto
     * @return boolean
     */
    boolean changePassword(UserChangePasswordDTO dto);

    /**
     * 实名认证
     * @param dto 认证对象dto
     * @return boolean
     */
    boolean realNameAuth(UserRealNameAuthDTO dto);

    /**
     * 协助开通
     * @param dto 协助开通dto
     * @return boolean
     */
    boolean assistOpening(UserAssistOpeningDTO dto);

    /**
     * 用户编辑
     * @param dto 编辑dto
     * @return boolean
     */
    boolean userEdit(UserEditDTO dto);

    /**
     * 获取用户信息
     * @return AgentUserInfoDTO
     */
    AgentUserInfoDTO getCurrentUserInfo();
}
